<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core"
  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:vetlabtags="urn:jsptagdir:/WEB-INF/tags/vetlab">
  <jsp:directive.tag isELIgnored="false" />
  <div id="uleftColumn">
    <c:choose>
      <c:when test="${empty user}">
        <form method="post" action="${ctx}${uri}">
          <c:if test="${not empty errors.login}">
            <div class="error">${errors.login}</div>
          </c:if>
          <div class="row">
            <label for="email">Email:</label>
            <input id="email" type="text" name="email" />
          </div>
          <div class="row">
            <label for="password">Password:</label>
            <input id="password" type="password" name="password" />
          </div>
          <div class="row">
            <input type="submit" name="login" value="Entra" class="submit" />
            <input type="submit" name="register" value="Registrati" class="submit register"
              onclick="location.href = '${ctx}/registrazione.html'; return false;" />
          </div>
        </form>
      </c:when>
      <c:otherwise>
        <p>
          Benvenuto
          <br />
          <strong>${user.firstName} ${user.lastName}</strong>
        </p>
        <div style="margin-top: 10px; text-align: center">
          <c:if test="${user.admin}">
            <input type="submit" name="admin" value="Amministra" class="submit" style="margin-right: 5px"
              onclick="location.href = '${ctx}/amministrazione.html'; return false;" />
          </c:if>
          <input type="submit" name="logout" value="Esci" class="submit"
            onclick="location.href = '${ctx}${uri}?logout=true'; return false;" />
        </div>
      </c:otherwise>
    </c:choose>
  </div>
</jsp:root>